import 'package:flutter/material.dart';
import 'package:flutter_svg/svg.dart';
import 'package:interview/config/app.enum.dart';

class PageEmpty extends StatelessWidget {
  final bool showIcon; // 去掉可空性，默认值在构造函数中定义
  const PageEmpty({
    super.key,
    this.showIcon = true, // 默认值设置为 true
  });

  @override
  Widget build(BuildContext context) {
    return Center(
      child: showIcon
        ? SvgPicture.asset(
            "${AppEnumAssets.basePath}empty.svg", // 确保资源路径正确
            width: 196,
            height: 196,
          )
        : const Text(
            "暂无数据~",
            style: TextStyle(fontSize: 12, fontWeight: FontWeight.bold),
          ),
    );
  }
}
